<?php

namespace App\Models\Plane\Airports;

use App\Trip\Geo\GeoManager;
use App\Trip\Geo\Location;
use App\Trip\Geo\RedisGeo;

class AirportsGeoManager extends GeoManager
{
    protected RedisGeo $geo;

    public function __construct()
    {
        $key       = "Airport:AirportGeo";
        $this->geo = new RedisGeo($key);
    }

    function addGeoByAirport(Airport $airport): void
    {
        if (!$airport->location) {
            return;
        }
        $location = new Location($airport->location);
        $this->addGeoByLocation($location, $airport->getCode());
    }

}